<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <style>
      * {
        padding: 0;
        margin: 0;
      }
      ul {
        margin: 100px;
      }
      ul li {
        float: left;
        margin: 0 4px;
        list-style: none;
        width: 120px;
        height: 35px;
        /* .box 也需要透视效果，所以加在 .box 父元素 */
        perspective: 500px;
      }
      .box {
        position: relative;
        /* 开启 3d 呈现 */
        transform-style: preserve-3d;
        width: 100%;
        height: 100%;
        transition: all 1s;
      }
      .box:hover {
        transform: rotateX(90deg);
      }
      .front,
      .bottom {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        height: 100%;
        line-height: 35px;
        text-align: center;
        font-size: 24px;
        color: aliceblue;
      }
      .front {
        background-color: pink;
        transform: translateZ(17px);
      }
      .bottom {
        background-color: purple;
        transform: translateY(17px) rotateX(-90deg);
      }
    </style>
  </head>
  <body>
    <ul>
      <li>
        <div class="box">
          <div class="front">什么是</div>
          <div class="bottom">惊喜？</div>
        </div>
      </li>
      <li>
        <div class="box">
          <div class="front">什么是</div>
          <div class="bottom">惊喜？</div>
        </div>
      </li>
      <li>
        <div class="box">
          <div class="front">什么是</div>
          <div class="bottom">惊喜？</div>
        </div>
      </li>
      <li>
        <div class="box">
          <div class="front">什么是</div>
          <div class="bottom">惊喜？</div>
        </div>
      </li>
    </ul>
  </body>
</html>
